<template>
    <div>
      <el-button @click="dosetPlayer">下一步</el-button>
      <div class="content">
        <el-descriptions class="margin-top" title="带边框列表" :column="3" :size="size" border>
      <template slot="extra">
        <el-button type="primary" size="small">操作</el-button>
      </template>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user"></i>
            角色
          </template>
          {{ player.name }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-mobile-phone"></i>
            攻击
          </template>
          {{ player.attack }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            防御
          </template>
          {{ player.defend }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            装备
          </template>
          <el-tag size="small">学校</el-tag>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            背包
          </template>
          <el-tag size="small">学校</el-tag>
        </el-descriptions-item>
      </el-descriptions>
      </div>
    </div>
  </template>
  
  <script>
  import LAY_EXCEL from 'lay-excel';
  import { getPlayer,setPlayer } from '../../api/index';
  export default {
    data () {
      return {
        player:{}
      }
    },
    mounted() {
      this.dogetPlayer()
    },
    methods: {
      dogetPlayer () {
        getPlayer(1).then(e=>{
          if (e.code == 200) {
            this.player = e.data
          }
        })
      },
      dosetPlayer () {
        this.player.attack+=1
        setPlayer(this.player).then(e=>{

        })
      }
  }
}
  </script>
  